import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home/Home.vue'
import Photo from '../views/Photo/Photo.vue'
import Information from '../views/Information/Information.vue'
import UserPhoto from '../views/Information/UserPhoto.vue'
import User from '../views/Information/User.vue'
import Like from '../views/Information/Like.vue'
import UserWatch from '../views/Information/UserWatch.vue'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home
    }, {
      path: '/photo/:id',
      name: 'photo',
      component: Photo
    }, {
      path: '/user/:id',
      name: 'user',
      component: User,
      children: [
        {
          name: 'userPhoto',
          path: '',
          component: UserPhoto
        },
        {
          name: 'information',
          path: 'information',
          component: Information
        },
        {
          name: 'like',
          path: 'like',
          component: Like
        },
        {
          name: 'watch',
          path: 'watch',
          component: UserWatch
        }
      ]
    }
  ]
})

export default router
